from manim import *

# manim -qm -v WARNING PolygonToCirlce.py
class PolygonToCirlce(Scene):
    def construct(self):
        array=[]
        a=RegularPolygon(n=4)
        
        array.append(a)
        
        # for i in range(5,10):
        #     array.append(RegularPolygon(n=i))
        
        for i in range(1,5):
            # print(i)
            # print(2**i)
            array.append(RegularPolygon(n=4*(2**i)))
            
        
        c=Circle()
        
        self.play(Create(a))
        self.wait()
        
        for i in range(len(array)-1):
            # self.add(array[i])
            self.play(Transform(a, array[i]))
        
        self.play(Transform(a, c))
        
        # a=RegularPolygon(n=5)
        
        # self.play(Create(a))
        
        # b=RegularPolygon(n=6)
        
        # self.play(Transform(a, b, use_override=False))
        
        # c=RegularPolygon(n=7)
        
        # self.play(Transform(a, c, use_override=False))
        
        # d=RegularPolygon(n=8)
        
        # self.play(Transform(a, d, use_override=False))